package com.yunweiweishi.xuhuanpaltform.yuhuan_app.controller;


import com.yunweiweishi.xuhuanpaltform.yuhuan_app.comm.conf.CommonResult;
import com.yunweiweishi.xuhuanpaltform.yuhuan_app.pojo.PatrolRecord;
import com.yunweiweishi.xuhuanpaltform.yuhuan_app.service.PatrolRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@Api(value = "巡检结果", tags = {"巡检结果controller"})
@RestController
@RequestMapping("/PatrolRecordList")
public class PatrolRecordController {

    @Autowired
    private PatrolRecordService patrolRecordService;



    @Autowired
    private CommonResult result;




    @ApiOperation( value = "查询巡检报告列表")
    @GetMapping("/findAllRecordList")
    public CommonResult findAllRecordList(  ) {

        try {

            List<PatrolRecord> patrolRecordList = patrolRecordService.findAllRecordList();
            result.setData(patrolRecordList);
            return result;
        } catch (Exception e) {
            e.printStackTrace();
            result.setState(500);
            result.setMsg("失败");
            return result;
        }


    }


}
